using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using PlugNT.Cms.BLL;
using PlugNT.Cms.Model;
using PlugNT.Cms.Page;

namespace PlugNT.Cms.Web.Admin.Pre_GroupAdmin
{
    public partial class Admin : AdminPager
    {
        private GroupAdmin bllGroupAdmin = new GroupAdmin();
        private int pageSize = 15;

        protected void Page_Load(object sender, EventArgs e)
        {

            this.CheckPower();

            if (!IsPostBack)
            {
                rptAdmin_bind();
            }
        }



        private  void rptAdmin_bind()
        {
            string t = (Request.QueryString["t"] == null) ? "" : Request.QueryString["t"].Trim();
            string id = (Request.QueryString["id"] == null) ? "0" : Request.QueryString["id"].Trim();
            if (t == "delete")
            {
                Delete(int.Parse(id));
            }
            DataTable dt = bllGroupAdmin.GetList();

            rptAdmin.DataSource = dt;
            rptAdmin.DataBind();
        }


        private void Delete(int id)
        {

            this.CheckReadOnly();

            bllGroupAdmin.Delete(id);
        }
        
    }
}

